package com.yqw.enhance;

import java.util.AbstractList;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
    	List<String> stringList = new ArrayList<>();
    	stringList.add("A");
    	stringList.addAll(Arrays.<String>asList());
        System.out.println( "Hello World!" );
        ArrayList<Card> newDeck = Card.newDeck();
        for (Card card : newDeck) {
			System.out.println(card);
		}
    }
    
 // List adapter for primitive int array
    public static List<Integer> asList(final int[] a) {
        return new AbstractList<Integer>() {
            public Integer get(int i) { return a[i]; }
            // Throws NullPointerException if val == null
            public Integer set(int i, Integer val) {
                Integer oldVal = a[i];
                a[i] = val;
                return oldVal;
            }
            public int size() { return a.length; }
        };
    }
}
